package com.mayihr.fx.attributeBind;

import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;

public class Main {
    public static void main(String[] args) {
        Bill electricBill = new Bill();
        electricBill.amountDueProperty().addListener(new ChangeListener() {
            @Override
            public void changed(ObservableValue observable, Object oldValue, Object newValue) {
                System.out.println(oldValue);
                System.out.println(newValue);
                System.out.println("Electric bill has changed!");
            }
        });

        electricBill.setAmountDue(100.00);
        electricBill.setAmountDue(101.00);
        electricBill.setAmountDue(102.00);
        electricBill.setAmountDue(103.00);
    }
}
